//
//  DQRegistViewController.m
//  DQBaisibudejie
//
//  Created by 杜倩 on 16/9/2.
//  Copyright © 2016年 杜倩. All rights reserved.
//

#import "DQRegistViewController.h"
#import "DQLoginView.h"
#import "DQThreeLogin.h"
@interface DQRegistViewController ()
@property (weak, nonatomic) IBOutlet UIView *middleView;
@property (weak, nonatomic) IBOutlet UIView *bottomView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *leadR;

@end

@implementation DQRegistViewController
#pragma mark 单击已有账号切换页面
- (IBAction)buttonChange:(UIButton *)sender {
    sender.selected = ! sender.selected;
//    if (sender.selected) {
//        self.leadR.constant= -self.middleView.frame.size.width/2;
//    }else{
//        self.leadR.constant=0;
//    }
    self.leadR.constant = sender.selected == YES? -self.middleView.frame.size.width/2: 0 ;//三目运算符
    
}
- (IBAction)dismissControl:(id)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    DQThreeLogin *three=[DQThreeLogin threeLogin];
    [self.bottomView addSubview:three];
    
    DQLoginView *regist=[DQLoginView loadRegist];
    [self.bottomView addSubview:regist];
    
    
    DQLoginView *login=[DQLoginView loadLogin];
    [self.middleView addSubview:login];
}

-(void)viewDidLayoutSubviews{
    DQLoginView *regist=self.middleView.subviews[0];
    regist.frame=CGRectMake(0, 0, self.middleView.frame.size.width*0.5, self.middleView.frame.size.height);
    DQLoginView *login=self.middleView.subviews[0];
    login.frame=CGRectMake(self.middleView.frame.size.width*0.5, 0, self.middleView.frame.size.width*0.5, self.middleView.frame.size.height);
    
}



@end
